<template>
  <div>
    <el-drawer
      :title="translate('detail')"
      size="800px"
      :visible.sync="isShowModal"
    >
      <div class="mb20">
        <span class="property-title">发布计划</span>
      </div>
      <el-form label-suffix="：" label-width="auto">
        <el-form-item label="计划任务">
          <span>{{ detail.name }}</span>
        </el-form-item>
        <el-form-item label="发布账号">
          <span>{{ detail.publishUserName }}</span>
        </el-form-item>
        <el-form-item label="视频来源">
          <span>{{
            detail.siteIdsName ? detail.siteIdsName : "全部场地"
          }}</span>
        </el-form-item>
        <el-form-item label="视频日期">
          <span
            v-if="detail.searchTimeStart && detail.searchTimeEnd"
          >{{ detail.searchTimeStart }}~{{ detail.searchTimeEnd }}</span>
          <span v-else>当日视频</span>
        </el-form-item>
        <el-form-item label="视频封面">
          <img style="width: 40px" :src="detail.videoCover" alt="">
        </el-form-item>
        <el-form-item label="视频标题">
          <span>{{ detail.videoTitle }}</span>
        </el-form-item>
        <el-form-item label="视频话题">
          <span>{{ detail.dyVideoTopic }}</span>
        </el-form-item>
        <div
          v-if="detail.mountType == '0' || detail.mountType == '1'"
          class="mb20"
        >
          <span class="property-title">挂载设置</span>
        </div>

        <el-form-item
          v-if="detail.mountType == '0' || detail.mountType == '1'"
          label="挂载类型"
        >
          <span>{{
            detail.mountType == "0" ? "POI门店地址" : "抖音小程序"
          }}</span>
        </el-form-item>
        <template v-if="detail.mountType == '0'">
          <el-form-item label="门店地址">
            <span>{{ detail.address }}</span>
          </el-form-item>
        </template>
        <template v-if="detail.mountType == '1'">
          <el-form-item label="小程序标题">
            <span>{{ detail.dyMpTitle }}</span>
          </el-form-item>
          <el-form-item label="小程序APPID">
            <span>{{ detail.dyMpAppid }}</span>
          </el-form-item>
          <el-form-item label="小程序PATH">
            <span>{{ detail.dyMpPath }}</span>
          </el-form-item>
        </template>

        <div class="mb20">
          <span class="property-title">投放规则</span>
        </div>
        <el-form-item label="首次投放时间">
          <span>{{ detail.firstTime }}</span>
        </el-form-item>
        <el-form-item label="运行频次">
          <span>每{{ detail.intervalTime }}小时运行一次</span>
        </el-form-item>
        <el-form-item label="运行次数">
          <span>持续运行{{ detail.executeNum }}次后，停止运行</span>
        </el-form-item>
      </el-form>
    </el-drawer>
  </div>
</template>

<script>
import {
  launchDetailPost
} from '@/api'
export default {
  data() {
    return {
      detail: {},
      isShowModal: false
    }
  },
  methods: {
    getDetail(id) {
      launchDetailPost({ param: { id }}).then(res => {
        if (res.errorCode !== '000000') return
        this.detail = res.record
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
